package cn.tedu.review;

public class ReviewOOP {
    public static void main(String[] args) {
        BMW bmw = new BMW();
        bmw.setColor("五彩斑斓的黑");
        bmw.setPrice(99999);
        /*创建匿名对象，只使用一次*/
        new BMW().start();
        System.out.println(new BMW().getColor());
        System.out.println(bmw.getColor());
        System.out.println(bmw.getPrice());
        bmw.start();
    }
}

class BMW {
    private String color;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    private double price;

    public void start() {
        System.out.println("车子启动了");
        stop();
    }

    private void stop() {
        System.out.println("车子停止了");
    }
}
